package com.srlg.webflux.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.srlg.webflux.entity.Book;
import com.srlg.webflux.service.BookService;

import lombok.RequiredArgsConstructor;
import reactor.core.publisher.Mono;

@RestController
@RequiredArgsConstructor
@RequestMapping("book")
public class BookController {

    private final BookService bookService;

    @GetMapping("bookAuthor")
    public Mono<Book> getBookAndAuthor(Long id) {

        return bookService.getBookAndAuthor(id);
    }
}
